package test.com.edu.lawdoc.api;

import java.util.HashMap;
import java.util.Map;
import java.util.Stack;

public class ControllerRenderHelper {
    private Map<String, Object> resultMap = new HashMap<>();
    private Stack stack = new Stack<>();

    public void pushArgForMap(Object val) {
        stack.push(val);
        if(stack.size() == 2) {
            Object value = stack.pop();
            String key = String.valueOf(stack.pop());
            resultMap.put(key, value);
        }
    }

    public Map<String, Object> getResultMap() {
        return resultMap;
    }
}
